<template>
  <div id="info">
    <div class="title">
    <sapn
        style="position: absolute;left: 35%; border: 0cm;font-weight: bold; font-size: 60px; font-family: 'Courier New', Courier, monospace;">
      陕西理工大学投票管理系统
    </sapn>
    </div>
    <!-- 显示投票选项 -->
    <el-container>
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1', '3']" router>
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-message"></i>操作菜单</template>
            <el-menu-item-group>
              <el-menu-item index="/ManageInfo/yearPeopleManage" >年度人物管理</el-menu-item>
              <el-menu-item index="/ManageInfo/YearPeopleAccount">投票管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header  style=" background-color: #42b983; padding: 5px; text-align: right; font-size: 12px;height: 75px">
          <div style="float: left">
            <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
          </div>
          <span style="font-size: 40px; font-family: '华文彩云';">{{ account }}</span>
          <br>
          <el-button type="danger" size="mini" plain @click="logout()">退出登录</el-button>
        </el-header>
        <el-divider></el-divider>
        <el-main style="height: 100%">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      account: '',
    }
  },
  mounted() {
    this.account = sessionStorage.getItem("Roleuser");
  },
  methods: {
    logout() {
      sessionStorage.removeItem("Roleuser");
      sessionStorage.removeItem("token");
      sessionStorage.removeItem("name");
      sessionStorage.removeItem("account");
      this.$router.push('/login');
    },
  }
}

</script>

<style>
#yearPeople {
  top: 20%;
}

.tac {
  width: 24%;
}

#items {
  background-color: aliceblue;
  height: 100%;
  width: 60%;
  position: absolute;
  left: 20%;
  top: 15%;
}
</style>